package com.javastudy.forum.exception;

import com.javastudy.forum.common.AppResult;

/**
 * @author Chooker
 * @create 2023-08-08 14:42
 */
public class ApplicationException extends RuntimeException {
    private AppResult errorResult;

    public ApplicationException(AppResult errorResult) {
        // 加入if 报错 ，待查
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }

    public AppResult getErrorResult() {
        return errorResult;
    }
}
